<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <!--使用局部组件-->
<!--    使用v-bind动态绑定数据-->
    <login :name="name"></login>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    let login = {
        template: "<div><h1>欢迎，{{name}}</h1></div>",
        //参数列表
        props: ["name"]
    }
    const app = new Vue({
        el: "#app",
        data: {
            name:"yaya"
        },
        methods: {},
        //在components中注册局部组件
        components: {
            login: login
        }
    })
</script>
</body>
</html>